home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / ste / mega / wrap_fix.arc / WRAP_FIX.S < prev   
Text File  |  1992-03-18  |  2KB  |  89 lines

  1. ; Program:  WRAP_FIX.S
  2. ; Version 1.50
  3. ;
  4. ; Author:  BKM
  5. ; Copyright (c) 1992, BKM, All rights reserved
  6. ;
  7. ; Purpose:
  8. ;  This program will attempt to 'fix' the screen wrap on the Mega/STe
  9. ;  while in mono.
  10. ;
  11. ; How:
  12. ;  Whenever the Mega/STe is in monochrome and a setscreen (XBIOS 5) 
  13. ;  command is executed, with the resolution being passed as anything 
  14. ;  other than a -1, the screen can wrap.  We will replace the XBIOS 
  15. ;  (TRAP #14) routine with one that checks for a setscreen command and
  16. ;  for a parameter of 2 for the resolution.  If so, we will replace
  17. ;  the resolution value with -1.  It will then fall through to the old
  18. ;  XBIOS routine.
  19. ;
  20. ;**************************
  21. GEMDOS        equ    $01
  22. BIOS            equ    $0d
  23.  
  24. ; GEMDOS Routines
  25. Cconws        equ    $09
  26. Ptermres        equ    $31
  27.  
  28. ; BIOS Routines
  29. Setexec         equ    $05
  30.  
  31. ; XBIOS Routines
  32. Setscreen       equ    $05
  33. ;**************************
  34.     text
  35. _start:
  36.     lea    _end,a3            ; Get program size
  37.     suba.l    4(sp),a3
  38. _get_vec:
  39.     move.l    #-1,-(sp)        ; Get XBIOS vector
  40.     move.w    #46,-(sp)
  41.     move.w    #Setexec,-(sp)
  42.     trap    #BIOS
  43.     addq.l    #8,sp
  44.     move.l    d0,_oldvc        ; Save it
  45. _rep_vec:
  46.     move.l    #_My_Xbios,-(sp)    ; Replace with my own
  47.     move.w    #46,-(sp)
  48.     move.w    #Setexec,-(sp)
  49.     trap    #BIOS
  50.     addq.l    #8,sp
  51. _dsp_title:
  52.     move.l    #_Title,-(sp)        ; Display Title on screen
  53.     move.w    #Cconws,-(sp)
  54.     trap    #GEMDOS
  55.     addq.l    #6,sp
  56. _finish:
  57.     move.w    #0,-(sp)        ; Exit and retain our program
  58.     move.l    a3,-(sp)
  59.     move.w    #Ptermres,-(sp)
  60.     trap    #GEMDOS
  61.     illegal                ; If we ever get here, we're
  62.                     ; in big trouble!
  63. _My_Xbios:
  64.     move.l    usp,a0
  65.     cmpi.w    #Setscreen,(a0)        ; Command is Setscreen?
  66.     bne.s    _exit            ; No - fall through
  67.     cmpi.w    #$02,$0a(a0)        ; Resolution = 2 (Mono?)
  68.     bne.s    _exit            ; No - fall through
  69.     move.w    #-1,$0a(a0)        ; Yes- replace with -1
  70. _exit:
  71.     movea.l    _oldvc,a0        ; Fall through
  72.     jmp    (a0)
  73.     illegal                ; If we ever get here, we're
  74.                     ; in big trouble!
  75.     even
  76.     data
  77.  
  78. _Title:    dc.b    $0d,$0a,$1b,'p'
  79.     dc.b    'Wrap Fix 1.50',$9e
  80.     dc.b    $1b,'q',$0d,$0a
  81.     dc.b    ' (c) BKM 1992 '
  82.     dc.b    $0d,$0a,$00
  83.  
  84.     even
  85.     bss
  86.  
  87. _oldvc: ds.l    1
  88. _end:
  89.